<template>
  <div>
    <mytopfun title="我的收藏">
      <van-icon name="arrow-left" slot="left" @click="$router.go(-1)" />
      <van-icon
        name="home-o"
        slot="right"
        @click="$router.push({ path: '/index' })"
        style="visibility: hidden"
      />
    </mytopfun>
    <!-- 文章列表的使用 -->
    <mypostlist
      v-for="(item, index) in starsList"
      :key="index"
      :postList="item"
    ></mypostlist>
  </div>
</template>

<script>
// 引入请求api
import { user_star } from "@/apis/user";
// 引人顶部组件
import mytopfun from "@/components/mytopfun";
// 引入文章列表组件
import mypostlist from "../components/mypostlist";
export default {
  components: {
    mytopfun,
    mypostlist,
  },
  data() {
    return {
      starsList: [],
    };
  },
  methods: {},
  async mounted() {
    // 页面加载得时候会加载页面列表
    let res = await user_star();
    // console.log(res.data.data);
    // 把加载得数据传入data
    this.starsList = res.data.data;
  },
};
</script>
<style lang="less" scoped>
</style>
